use crate::{bootstrap::AppState, router::resp};
use axum::{
    extract::{Path, Query, State},
    response::IntoResponse,
};
use serde::{Deserialize, Serialize};
use utoipa::{IntoParams, ToSchema};

#[derive(Deserialize)]
pub struct SampleParams {
    #[serde(default)]
    name: Option<String>,
}


#[utoipa::path(get, 
               path = "/{name}",
               tag = "hello world",
               params(
                ("name" = String, Path, description = "Your name")
            ),        
)]
pub async fn hello_world(Path(query): Path<SampleParams>) -> impl IntoResponse {
    match query.name {
        Some(name) => {
            format!("hello world: {}", name)
        },
        None => "hello world".to_string(),
    }
}
